<template>
    <div>
       <div>
        <header>
          <el-row type="flex" class="row-bg" justify="space-between">
            <router-link to="/user">
              <el-col :span="6">
                <div class="grid-content bg-purple">
                  <span class="iconfont">&#xe609;</span>
                </div>
              </el-col>
            </router-link>
            <div style="margin-right: 40.5%;color: #fff; font-size: 20px;">参与者</div>
          </el-row>
        </header>
        <div style="height: 40.8px"></div>
      </div>
      <el-card class="box-card" v-for="item in partnerList" :key="item.activityId">
        <div slot="header" class="clearfix">
          <span>{{'活动名称：'+item.activityName}}</span>
        </div>
          <table>
            <tr>
              <td>姓名</td>
              <td>联系方式</td>
              <td>人数</td>
            </tr>
            <tr v-for="(itemson,index) in item.partner" :key="index">
              <td>{{itemson.partnerName}}</td>
              <td>{{itemson.partnerNumber}}</td>
              <td>{{itemson.joinNumber}}</td>
            </tr>
          </table>
      </el-card>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    name: 'partner',
    props: {
      userId: String
    },
    data() {
      return {
        partnerList: []
      }
    },
    methods: {
      getHomeInfo () {
          axios.get('/static/mock/partner.json')
              .then(this.getHomeInfoSucc)
      },
      getHomeInfoSucc (res) {
          res = res.data
          if (res.ret && res.data) {
              const data = res.data
              this.partnerList = data.partnerList
          }else {
              alert('数据获取失败')
          }
          console.log(res)
      }
    },
    mounted () {
        this.getHomeInfo()
    }
}
</script>

<style scoped>
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    line-height: 2.5rem;
    background: #67C23A;
    text-align: center;
  }
  .iconfont {
    font-size: 1.6rem;
    color: #fff;
    margin-left: .4rem;
  }
  .text {
    font-size: 14px;
  }
  .item {
    margin-bottom: 18px;
  }
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  .box-card {
    width: 100%;
  }
  table {
    text-align: center;
  }
  tr td{
    width: 120px;
    background: #eee;
    padding: 10px 0;
    font-size: 14px;
  }
</style>